﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Syspetro.Core.CommandBus
{
    public static class CommandMap
    {
        public static Dictionary<string, List<Type>> Mappings = new();

        public static void Add(string key, Type type)
        {
            if (!Mappings.ContainsKey(key))
            {
                Mappings.Add(key, new List<Type> { });
            }
            Mappings[key].Add(type);
        }
        public static void Add(string key, List<Type> types)
        {
            if (!Mappings.ContainsKey(key))
            {
                Mappings.Add(key, new List<Type> { });
            }
            Mappings[key].AddRange(types);
        }
    }
}
